package priv.winnine.util;

import priv.winnine.entity.enums.ResultEnum;
import priv.winnine.entity.vo.Response;

public class ResultUtil {

    public static Response success() {
        return result(ResultEnum.SUCCESS);
    }

    public static Response fail() {
        return result(ResultEnum.FAIL);
    }

    public static Response success(String data) {
        return result(ResultEnum.SUCCESS, data);
    }

    public static Response fail(String data) {
        return result(ResultEnum.FAIL, data);
    }

    public static Response result(ResultEnum resultEnum) {
        return new Response(resultEnum.getCode(), resultEnum.getMessage());
    }

    public static Response result(ResultEnum resultEnum, String data) {
        return new Response(resultEnum.getCode(), resultEnum.getMessage()).addData(data);
    }

    public static Response result(int code, String message) {
        return new Response(code, message);
    }
}
